package main

import (
	"errors"
	"go-shell/src/lib/check"
	"go-shell/src/lib/fileutil"
	"os"
)

func main() {
	source := os.Args[1]
	if !fileutil.IsExist(source) {
		panic(errors.New("expect file exists"))
	}
	children, err := os.ReadDir(source)
	check.CheckErrNil(err)
	for _, item := range children {
		fileinfo, err := item.Info()
		check.CheckErrNil(err)
		if item.IsDir() {
			println(fileinfo.Name())
		} else {
			println(fileinfo.Name())
		}
	}
}
